package test2.redis;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class FileUtil {
	
	public static String readfile(String name) {
		InputStream is = FileUtil.class.getResourceAsStream(name);
		BufferedReader br = new BufferedReader(new InputStreamReader(is));
		String str = "";
		while(true) {
			String line = null;
			try {
				line = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			if(line!=null) {
				str += line + "\n";
			} else {
				break;
			}
		}
		return str;
	}

}
